﻿require.config({
  urlArgs: "version=20170501",
  paths: {
    'jquery': '../packages/jquery-2.14-min',
    'bootstrap': '../../bootstrap/js/bootstrap.min',
  },
  shim: {
    'bootstrap': {
      deps: ['jquery'],
      exports: 'bootstrap'
    }
  }
});




require(['jquery','bootstrap'], function ($) {

	var myChart = echarts.init(document.getElementById('content-right-classify1'));
  $('#graph-1001').click(function () {
  	drawGraph_1001();
	  $('#graph-show').modal('show');
  });
  $('#graph-1002').click(function () {
		drawGraph_1002();
	 	 $('#graph-show').modal('show');
	  });
	  
	  $('#graph-1003').click(function () {
	  	drawGraph_1003();
		  $('#graph-show').modal('show');
	  });

	  $('#graph-1004').click(function () {
	  	drawGraph_1004();
		  $('#graph-show').modal('show');
	  });

	  $('#graph-1005').click(function () {
	  	drawGraph_1005();
		  $('#graph-show').modal('show');
	  }); 
	  
	  function drawGraph_1001() {
			/**
			 *ajax获取相应的数据 专利申请趋势
			 */
			dataX = [];
		  	valueY = [];
		  	comment = [];
			$.ajax({
			type : 'GET',
			url : '/draw/graph/5001',
			//data : jsonda,
			cache: false,
			async:false,
			//contentType: "application/json; charset=utf-8",
			dataType : 'json',
			success : function(res) {
				valueY = res.yValue;
				dataX = res.xAxis;
				comment = res.comment;
			},
			error : function(xml, err, throwInfo) {
				alert(err);
			}
			});
			myChart.clear();
			//alert(comment);
			var symbolSize = 20;
			option = {
	   		 title: {
	       		 text: '专利申请趋势'
	   		 },
	   		 tooltip: {
	        		trigger: 'axis'
	   		 },
	   		color: ['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
	   			'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
	   			'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
	   			'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'],
	   		dataZoom: [
	            {
	                show: true,
	                //yAxisIndex: 0,
	                start: 0,
	                end: 100,
	                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
	                handleStyle: {
	                   color: '#fff',
	                   shadowBlur: 3,
	                   shadowColor: 'rgba(0, 0, 0, 0.6)',
	                   shadowOffsetX: 2,
	                   shadowOffsetY: 2
	                   }
	                
	            },
	            {
	                type: 'inside',
	                start: 0,
	                end: 100
	            },
	            ],
	            grid: {
	            top: '12%',
	            left: '1%',
	            right: '10%',
	            containLabel: true
	        },
	   		 toolbox: {
	       		 feature: {
	           	 	saveAsImage: {}
	        		}
	  		  },
	  		  xAxis: {
	       		  type: 'category',
	       		  boundaryGap: false,
	       		  name:'申请年',
	       		  nameLocation:'middle',
	      		  nameGap: 20,
	      		  data: dataX
	   		 },
	   		 yAxis: {
	      		  type: 'value',
	       		  name:'专利申请量(件)',
	       		  nameLocation:'middle',
	       		  nameGap: 40
	  		  },
	   		 series: [
	      		  {
	          	  name:'专利申请量(件)',
	         	  type:'line',
	          	  symbolSize: symbolSize,
	          	  data: valueY
	        }
	    ],
	    
	};
			 myChart.setOption(option);
		}

		function drawGraph_1002() {
			/**
			 *ajax获取相应的数据 专利授权趋势
			 */
			dataX = [];
		  	valueY = [];
			//文字描述
		  	comment = [];
			//文字描述
			$.ajax({
			type : 'GET',
			url : '/draw/graph/5002',
			//data : jsonda,
			cache: false,
			async:false,
			//contentType: "application/json; charset=utf-8",
			dataType : 'json',
			success : function(res) {
				valueY = res.yValue;
				dataX = res.xAxis;
				//文字描述
				comment = res.comment;
				//文字描述
			},
			error : function(xml, err, throwInfo) {
				alert(err);
			}
			});
			myChart.clear();
			//alert(comment);
			var symbolSize = 20;
			option = {
	   		 title: {
	       		 text: '专利授权趋势'
	   		 },
	   		 tooltip: {
	        		trigger: 'axis'
	   		 },
	   		color: ['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
	   			'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
	   			'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
	   			'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'],
	   		dataZoom: [
	            {
	                show: true,
	                //yAxisIndex: 0,
	                start: 0,
	                end: 100,
	                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
	                handleStyle: {
	                   color: '#fff',
	                   shadowBlur: 3,
	                   shadowColor: 'rgba(0, 0, 0, 0.6)',
	                   shadowOffsetX: 2,
	                   shadowOffsetY: 2
	                   }
	                
	            },
	            {
	                type: 'inside',
	                start: 0,
	                end: 100
	            },
	            
	            ],
	            grid: {
	            top: '12%',
	            left: '1%',
	            right: '10%',
	            containLabel: true
	        },
	   		 toolbox: {
	       		 feature: {
	           	 	saveAsImage: {}
	        		}
	  		  },
	  		  xAxis: {
	       		  type: 'category',
	       		  boundaryGap: false,
	       		  name:'申请年',
	       		  nameLocation:'middle',
	      		  nameGap: 20,
	      		  data: dataX
	   		 },
	   		 yAxis: {
	      		  type: 'value',
	       		  name:'专利授权量(件)',
	       		  nameLocation:'middle',
	       		  nameGap: 40
	  		  },
	   		 series: [
	      		  {
	          	  name:'专利授权量(件)',
	         	  type:'line',
	          	  symbolSize: symbolSize,
	          	  data: valueY
	        }
	    ]
	};
			 myChart.setOption(option);
		}
		
		

});